Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor: Reduce iter complexity in header_stats #325

Merged
merged 1 commit into from
Jul 8, 2023

Conversation

TieWay59
Copy link

@TieWay59 TieWay59 commented Jul 5, 2023

This PR did three change:

  1. Moved the sorted_by operation after the map, saving space in the intermediate vector that sorted_by builds.
  2. Replaced a fold operation with a straightforward sum.
  3. Utilized zip to calculate jtr, reducing the need for an additional get step.

1. Moved the `sorted_by` operation after the map, saving space in the intermediate vector that `sorted_by` builds.
2. Replaced a `fold` operation with a straightforward `sum`.
3. Utilized `zip` to calculate `jtr`, reducing the need for an additional `get` step.
@TieWay59
Copy link
Author

TieWay59 commented Jul 5, 2023

Hi @orf, It's me again. I believe this PR is easy to review.

Please let me know if this kind of refactoring is annoying. I do it because I spend some time reading open-source code every day and I'll have some ideas about the code I read.

@orf orf merged commit 439cbc7 into orf:master Jul 8, 2023
@orf
Copy link
Owner

orf commented Jul 8, 2023

Hey @TieWay59, thank you for this! I don't think it's annoying - I think it's great! So please if you spot any more chances to make things better then don't hesitate to drop an issue or open a pull request! <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants